<html>
<head><meta charset="utf-8"><title>fundamental and coherence · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/fundamental.20and.20coherence.html">fundamental and coherence</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211679992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/fundamental%20and%20coherence/near/211679992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/fundamental.20and.20coherence.html#211679992">(Sep 29 2020 at 20:30)</a>:</h4>
<p>ext/lib.rs</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(fundamental)]</span><span class="w"></span>

<span class="cp">#[fundamental]</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">struct</span> <span class="nc">Foo</span><span class="o">&lt;</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="n">U</span><span class="o">&gt;</span><span class="p">(</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="n">U</span><span class="p">);</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>

<p>other/lib.rs</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">use</span><span class="w"> </span><span class="n">ext</span>::<span class="p">{</span><span class="n">Foo</span><span class="p">,</span><span class="w"> </span><span class="n">Bar</span><span class="p">};</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">Local</span><span class="p">;</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;</span><span class="nb">Vec</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">Local</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>

<p>This compiles</p>
<p>also adding <code>#[fundamental]</code> to a type is a breaking change <span aria-label="shock" class="emoji emoji-1f628" role="img" title="shock">:shock:</span> I didn't realize that</p>



<a name="211680289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/fundamental%20and%20coherence/near/211680289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/fundamental.20and.20coherence.html#211680289">(Sep 29 2020 at 20:33)</a>:</h4>
<p>yes it definitely is</p>



<a name="211680307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/fundamental%20and%20coherence/near/211680307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/fundamental.20and.20coherence.html#211680307">(Sep 29 2020 at 20:33)</a>:</h4>
<p>adding and removing fundamental both :)</p>



<a name="211680314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/fundamental%20and%20coherence/near/211680314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/fundamental.20and.20coherence.html#211680314">(Sep 29 2020 at 20:33)</a>:</h4>
<p>everything about "fundamental-ness" kind of has to be defined up front</p>



<a name="211680325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/fundamental%20and%20coherence/near/211680325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/fundamental.20and.20coherence.html#211680325">(Sep 29 2020 at 20:33)</a>:</h4>
<p>orphan rules are so annoyingly zero sum</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>